package com.zhp.dao;

import com.zhp.dao.base.BaseDao;
import com.zhp.model.ConJoin;
import com.zhp.utils.JDBCUtil;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

public class ConJonDao extends BaseDao<ConJoin> {
    public ConJonDao() {
        super(ConJoin.class);
    }

    public boolean join(String mId,String uId) {
        String sql = "UPDATE con_join SET status = 1 WHERE c_id = ? and u_id = ?";
        QueryRunner queryRunner = new QueryRunner(JDBCUtil.getDataSource());
        try {
            int row = queryRunner.update(sql, mId,uId);
            return row > 0;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;

    }
}
